import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from python_ai.common.xcommon import sep

np.random.seed(666)
df = pd.DataFrame(np.random.randn(100, 4),
                  columns=list('ABCD'),
                  index=pd.date_range('20200101', periods=100, freq='D'))
print(df)

df.plot()
plt.show()
df.plot.bar()
plt.show()
df.plot.bar(stacked=True)
plt.show()
df.plot.barh()
plt.show()
df.plot.barh(stacked=True)
plt.show()
df.hist(bins=5)  # one diagram each column
plt.show()
df.plot.hist(bins=5)  # together
plt.show()
plt.title('boxplot')
df.boxplot()  # with horizontal lines
plt.show()
df.plot.box()  # without horizontal lines
plt.show()
df.plot.scatter(x='A', y='B')
plt.show()
